These routines allow programmers to manipulate path strings from within nShell commands.
NSH_path_expand
---------------
int NSH_path_expand(Str255 path);
PARAMETERS
Str255 path address of a Pascal string to be updated
RETURNS
0 success
others failure
PROCESS
Given a full or partial pathname, NSH_expand will return the equivalent full pathname. This routine does not check to see if any of the specified volumes, directories, or files exist.
This routine is equivalent to nShell's "pathchk" command.
NSH_path_to_FSSpec
------------------
int NSH_path_to_FSSpec( Str255 pathname, FSSpec *spec );
PARAMETERS
Str255 path pathname to be interpreted
FSSpec *spec address of a FSSpec to be filled
RETURNS
0 success
others failure
PROCESS
Given a full pathname (perhaps prepared by NSH_expand), this routine will produce an equivalent File System Specification. Any Finder aliases will be resolved.
NSH_path_which
--------------
int NSH_path_which(Str255 path);
PARAMETERS
Str255 path address of a pathname to be updated
RETURNS
-1 an error prevented the search
0 success
1 command not found
PROCESS
This routine examines the command-search-path and returns the location of the command with would be executed.
This routine is equivalent to nShell's "which" command.